#ifndef CONTROLWIDGET_H
#define CONTROLWIDGET_H
#include "nameSpace.h"


class controlsWidget : public QDockWidget , Ui::controlsWidgetUI {
    Q_OBJECT
public:
    enum CONTROL_COLUMNS { COL_TYPE=0,COL_DEVICE, COL_ADDRESS, COL_NODE,COL_VALUE};
    controlsWidget(QObject *parent,QList<rpi_control*> *l);
    ~controlsWidget();
private:
    QList<rpi_control*> *controls;
public slots:
    void refreshContent();
    void ControlChanged(int row, int column);
    void refreshControl(int k);
    void setPower(int v);
    void stopClicked();
    void setSteer(int v);
protected:
    EightBitSpinBox *spinDelegate;
    ComboBoxDelegate *comboTypes;
    DeviceDelegate *comboDevices;
    bool ignoreChanges;

    ControlModel *cModel;
    ControlModel *rModelItem;
    QStandardItemModel *sModel;
    //ControlModel *cm;
public:
signals:
    void controlUpdate(int i);
    void sendFastControl(int i,int v);
};

#endif // CONTROLWIDGET_H
